package com.vcredit.creditcat.model;

/**
 * 
 **/
import java.io.Serializable;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * 资源
 */
public class Resource implements Serializable {
	private static final long serialVersionUID = -1L;
	/** ID **/
	@JsonProperty("keyId")
	private Long id;
	/** 资源名称 **/
	@JsonProperty("text")
	private String name;
	/** 资源路径 **/
	@JsonProperty("href")
	private String value;
	/** 上级资源Id **/
	private Long pId;
	/** 主菜单类型 **/
	private Integer type;
	@JsonProperty("id")
	private String menuId;
	/** 资源类型 **/
	private Integer resourceType;
	/** 子资源对象集合 **/
	@JsonProperty("items")
	private List<Resource> resources;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public Long getpId() {
		return pId;
	}

	public void setpId(Long pId) {
		this.pId = pId;
	}

	@Override
	public boolean equals(Object obj) {
		
		if (obj == null || this == null)
			return false;
		if (!(obj instanceof Resource))
			return false;
		Resource r = (Resource) obj;
		if (this.id.equals(r.id))
			return true;
		return false;
	}

	public List<Resource> getResources() {
		return resources;
	}

	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}

	public Integer getResourceType() {
		return resourceType;
	}

	public void setResourceType(Integer resourceType) {
		this.resourceType = resourceType;
	}

	public Resource() {
		super();
	}
}